<?php
/**
 * Realty Controller
 *
 * @категория:  View
 * @пакет:      Croogo.Categories.Controller.View.Admin_Add
 * @версия:     1.0
 * @автор:      Калистратов Сергей Михайлович
 * @почта:      kalistratov.s.m@gmail.com
 * @телефон:    +7 (987) 310-56-02
 * @ссылка:     http://www.croogo.org
 */

$this->viewVars['title_for_layout'] = __d('croogo', 'Категория');

$this->Html
	->addCrumb('', '/admin', array('icon' => 'home'))
	->addCrumb(__d('croogo', 'Категория'), array('action' => 'index'));

if ($this->action == 'admin_edit') {
	$this->Html->addCrumb($this->data['Category']['name'], '/' . $this->request->url);
	$this->viewVars['title_for_layout'] = 'Category: ' . $this->data['Category']['name'];
} else {
	$this->Html->addCrumb(__d('croogo', 'Добавить'), '/' . $this->request->url);
}

echo $this->Form->create('Category');
?>
<div class="categories row-fluid">
	<div class="span8">
		<ul class="nav nav-tabs">
			<?php
			echo $this->Croogo->adminTab(__d('cakeshop', 'Категория'), '#category');
			echo $this->Croogo->adminTabs();
			?>
		</ul>

		<div class="tab-content">
			<div id='category' class="tab-pane">
				<?php

				$this->Form->inputDefaults(array('label' => false, 'class' => 'span10'));

				echo $this->Form->input('alias', array(
					'label' => __d('croogo' , 'Алиас'),
					'class' => 'slug'
				));

				echo $this->Form->input('category_id', array(
					'label' => __d('croogo', 'Родительская категория'),
					'options' => $categories,
					'empty' => true,
				));

				echo $this->Form->input('title', array(
					'label' => __d('croogo' , 'Название'),
				));
				echo $this->Form->input('description', array(
					'label' => __d('croogo' ,'Описание'),
				));

				echo $this->Croogo->adminTabs();
				?>
			</div>
		</div>
	</div>
	<div class="span4">
		<?php
		echo $this->Html->beginBox(__d('croogo', 'Publishing')) .
			$this->Form->button(__d('croogo', 'Apply'), array('name' => 'apply')) .
			$this->Form->button(__d('croogo', 'Save'), array('class' => 'btn btn-primary')) .
			$this->Html->link(__d('croogo', 'Cancel'), array('action' => 'index'), array('class' => 'btn btn-danger')) .
			$this->Form->input('status', array(
				'label' => __d('croogo', 'Status'),
				'class' => false,
			)) .
			$this->Html->endBox();
		?>
		<div class="accordion" id="accordion2">
			<div class="accordion-group">
				<div class="accordion-heading">
					<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseOne">
						<?php echo __d('croogo' , 'Metadata settings'); ?>
					</a>
				</div>
				<div id="collapseOne" class="accordion-body collapse in">
					<div class="accordion-inner">
						<?php
						echo $this->Form->input('seo_title', array(
							'label' => __d('croogo' , 'Seo title'),
						));

						echo $this->Form->input('seo_description' , array(
							'label' => __d('croogo' , 'Seo description')
						));

						echo $this->Form->input('seo_keywords' , array(
							'label' => __d('croogo' , 'Seo description')
						));
						?>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<?php echo $this->Form->end(); ?>
